package com.urfresh.sp.flume.api;

import com.urfresh.sp.flume.dto.Res;
import com.urfresh.sp.flume.dto.v2.CartClick;
import com.urfresh.sp.flume.dto.v2.PositionClick;
import com.urfresh.sp.flume.dto.v2.SubmitOrder;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

import java.util.List;

/**
 * Created by urfresh.mark on 2016/8/29.
 */
public interface ClientV2API {

    @ApiOperation(value = "列表页面的坑位点击数据", response = Res.class, notes = "rst=-1表示验证失败")
    @ApiResponses(value = {
            @ApiResponse(code = 500, message = "服务器内部错误"),
            @ApiResponse(code = 400, message = "提交的参数不正确"),
            @ApiResponse(code = 201, message = "提交成功")}
    )
    public Res positionClickList(
            @ApiParam(name = "sign", value = "", required = true)
                    String sign,
            @ApiParam(name = "坑位信息", value = "", required = true)
                    List<PositionClick> data);

    @ApiOperation(value = "列表页面的坑位点击数据", response = Res.class, notes = "rst=-1表示验证失败")
    @ApiResponses(value = {
            @ApiResponse(code = 500, message = "服务器内部错误"),
            @ApiResponse(code = 400, message = "提交的参数不正确"),
            @ApiResponse(code = 201, message = "提交成功")}
    )
    public Res positionClick(
            @ApiParam(name = "sign", value = "", required = true)
                    String sign,
            @ApiParam(name = "坑位信息", value = "", required = true)
                    PositionClick data);

    @ApiOperation(value = "购物车点击行为", response = Res.class, notes = "rst=-1表示验证失败")
    @ApiResponses(value = {
            @ApiResponse(code = 500, message = "服务器内部错误"),
            @ApiResponse(code = 400, message = "提交的参数不正确"),
            @ApiResponse(code = 201, message = "提交成功")}
    )
    public Res cartClickList(
            @ApiParam(name = "sign", value = "", required = true)
                    String sign,
            @ApiParam(name = "坑位信息", value = "", required = true)
                    List<CartClick> data);

    @ApiOperation(value = "购物车点击行为", response = Res.class, notes = "rst=-1表示验证失败")
    @ApiResponses(value = {
            @ApiResponse(code = 500, message = "服务器内部错误"),
            @ApiResponse(code = 400, message = "提交的参数不正确"),
            @ApiResponse(code = 201, message = "提交成功")}
    )
    public Res cartClick(
            @ApiParam(name = "sign", value = "", required = true)
                    String sign,
            @ApiParam(name = "坑位信息", value = "", required = true)
                    CartClick data);

    @ApiOperation(value = "准备下单的操作，指用户点击下单按钮、进入支付页面，点击确认支付操作行为记录", response = Res.class, notes = "rst=-1表示验证失败")
    @ApiResponses(value = {
            @ApiResponse(code = 500, message = "服务器内部错误"),
            @ApiResponse(code = 400, message = "提交的参数不正确"),
            @ApiResponse(code = 201, message = "提交成功")}
    )
    public Res submitOrderClickList(
            @ApiParam(name = "sign", value = "", required = true)
                    String sign,
            @ApiParam(name = "坑位信息", value = "", required = true)
                    List<SubmitOrder> data);

    @ApiOperation(value = "准备下单的操作，指用户点击下单按钮、进入支付页面，点击确认支付操作行为记录", response = Res.class, notes = "rst=-1表示验证失败")
    @ApiResponses(value = {
            @ApiResponse(code = 500, message = "服务器内部错误"),
            @ApiResponse(code = 400, message = "提交的参数不正确"),
            @ApiResponse(code = 201, message = "提交成功")}
    )
    public Res submitOrderClick(
            @ApiParam(name = "sign", value = "", required = true)
                    String sign,
            @ApiParam(name = "坑位信息", value = "", required = true)
                    SubmitOrder data);

    final String IMPLANT_POSITION_SINK = "urfresh.flume.implant.position";
    final String IMPLANT_CART_SINK = "urfresh.flume.implant.cart";
    final String IMPLANT_SUBMIT_ORDER_SINK = "urfresh.flume.implant.submitorder";

}
